% -----------------------------------------------------------------------------
% UFRJ
% PPGI
% MAB 733 Sistemas Distribuídos
%
% Revisado em 24/04/2013
% Autor: Cristiano Gurgel de Castro
% -----------------------------------------------------------------------------

\chapter{Trechos de Códigos}
\label{sec:codigos}

\begin{lstlisting}[caption=Operação de chamada ao WebService,label=cod:add,language=Java]
private static float add(float i, float j) {
  org.me.calculator.CalculatorWS_Service service = 
    new org.me.calculator.CalculatorWS_Service();
  org.me.calculator.CalculatorWS port = 
    service.getCalculatorWSPort();
  return port.add(i, j);
}
\end{lstlisting}

\lstinputlisting[caption=Serviço de calculadora,label=cod:calculatorws,firstline=14,lastline=25]{codes/CalculatorWS.java}

\lstinputlisting[caption=Chamada ao serviço web externo,
label=cod:numberconv,firstline=22,lastline=28]{codes/NumberToWords.java}

\begin{lstlisting}[caption=Erro de transporte HTTP,label=cod:httperror]
Exception in thread "AWT-EventQueue-0" 
com.sun.xml.internal.ws.client.ClientTransportException: 
HTTP transport error: java.net.ConnectException: 
Connection timed out: connect
\end{lstlisting}

\lstinputlisting[label=cod:phpclient,caption=Cliente \php,language=php]{codes/NumberConversion.php}

\lstinputlisting[label=cod:phphello,caption=Servidor \PHP\ \code{HelloWorld},language=php]{codes/server.php}

\lstinputlisting[label=cod:javaeclipseclient,caption=Cliente de serviços
Web Java,firstline=19]{codes/ConverterClient.java}

\lstinputlisting[label=cod:phpfactorial,caption=Serviço de Fatorial em \PHP]{codes/fatorial.php}

\lstinputlisting[label=cod:remote:math:eclipse,caption=Cliente de \WebService s
remotos de operações matemáticas.,firstline=31]{codes/RemoteMathOperations2.java}

\lstinputlisting[label=cod:remote:conversion:eclipse,caption=Cliente de
\WebService\ de escrita por extenso,firstline=22]{codes/RemoteNumberToWords.java}
